<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */

/**
 * Smarty txt_encrypt modifier plugin
 * @author Jason
 */
function smarty_modifier_txt_encrypt( $string )
{
	$temp	=	array_unique( str_split( $string ) );
	$repl	=	array( );
	
	foreach( $temp as $character )
	{
		$repl[$character] =  '&#' . ord( $character ) . ';';
	}
		
	return strtr( $string, $repl );
}

/* vim: set expandtab: */

?>
